import axios from 'axios';

// 发送请求
function send(url, params, cb, method = 'post') {
    axios.request({
        method: method,
        url: url,
        data: params,
        headers: {
            'content-type': 'application/x-www-form-urlencoded;charset=utf-8'
        }
    }).then(function (res) {
        return cb(res.data)
    }).catch((error) => {
        return cb({code: -1, msg: '请求失败'})
    });
}

export default {
    send
}
